package com.lagou.mapper;

import com.lagou.domain.Article;
import com.lagou.domain.Comment;
import org.apache.ibatis.annotations.Many;
import org.apache.ibatis.annotations.Result;
import org.apache.ibatis.annotations.Results;
import org.apache.ibatis.annotations.Select;
import org.apache.ibatis.mapping.FetchType;

import java.util.List;

public interface ArticleMapper {
   /* @Select("SELECT * FROM t_article WHERE id=#{id}")
    @Results({
            @Result(id = true,column = "id",property = "id"),
            @Result(column = "title",property = "title"),
            @Result(column = "content",property = "content"),
            @Result(property = "commentList",javaType = List.class,column = "id",many = @Many(select = "com.lagou.mapper.CommentMapper.findAllByAid",fetchType = FetchType.LAZY))
    })*/

    public Article findArticle(Integer id);


}
